package com.kit.data.kitopeso.dialog;

import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.kit.data.kitopeso.base.BaseDialog;
import com.kit.data.kitopeso.databinding.KitoLimitDialogBinding;
import com.kit.data.kitopeso.tools.ViewUtils;


public class LimitDialog extends BaseDialog<KitoLimitDialogBinding> {



    public LimitDialog(@NonNull Context context) {
        super(context);
    }

    public LimitDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected LimitDialog(@NonNull Context context, boolean cancelable, @Nullable DialogInterface.OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected KitoLimitDialogBinding initViewBinding(LayoutInflater inflater) {
        return KitoLimitDialogBinding.inflate(inflater);
    }

    @Override
    protected void initView() {
        binding.tvColse.setOnClickListener(v -> {
            ViewUtils.viewScale(v);
            dismiss();
        });
        binding.tvBtn.setOnClickListener(v -> {
            ViewUtils.viewScale(v);
            if (onBtnClickListener != null) {
                onBtnClickListener.btnOnClickOk();
            }
            dismiss();
        });
    }

    public void setData(String name, String amout1, String amout2) {
        binding.tvName.setText(name);
        binding.tvAmout1.setText(amout1);
        binding.tvAmout2.setText(amout2);
    }

}
